home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update20.zoo / curses / diffs
Encoding:
Text File  |  1992-04-19  |  16.5 KB  |  674 lines

  1. *** 1.10    1992/03/06 19:40:24
  2. --- Changelo    1992/04/19 16:43:23
  3. ***************
  4. *** 109,111 ****
  5. --- 109,143 ----
  6.       back out the above change to xconsole as it plays havoc with
  7.   international kbds where some of the more regular keys are entered by
  8.   alt'ing.
  9. + -------------------------- Patchlevel  11 ---------------------------------
  10. + tgetent.c:: ++jrb
  11. +     update default term entry to the one Michal posted.
  12. + xconsole.c:: ++jrb
  13. +     sync up with console.c: alexander lehmann had a
  14. +   fix there for a bug where console i/o would get stuck when a interrupt
  15. +   was caught and it occured when the input buffer was not empty.
  16. + tgetent.c:: Michal
  17. +     when I needed it I found that our tgetent routine is buggy since it
  18. +     does not process correctly terminal descriptions with 'tc=...'
  19. +     capabilities.  It will also barf on unlikely but legal termcap files
  20. +     where terminal names are split across escaped lines.  Use of
  21. +     a static fopenp() does not help either, since that means that
  22. +     forms of PATH you can use there are more restrictive than in other
  23. +     places.  Therefore I rewrote that whole file quite a bit.
  24. +     tgetent() now is maybe too permissible but I do not think that
  25. +     it will exclude a valid termcap description.
  26. +     One more modification.  When default terminal description is in use
  27. +     then I am filling values for 'co' and 'li' from Line-A variables
  28. +     instead of using a hardwired stuff.
  29. + xconsole.c:: ++jrb
  30. +     sync up with lib/console.c again. (andreas's change)
  31. +     -- console.c (raw_in): allow typeahead (which is only available at
  32. +         GEMDOS level).
  33. + -------------------------- Patchlevel  12 ---------------------------------
  34. *** 1.9    1992/03/06 19:40:24
  35. --- PatchLev.h    1992/04/19 16:43:24
  36. ***************
  37. *** 1,5 ****
  38.   /*
  39. !  *    PathLevel: 11
  40.    *
  41.    *    the Patch Level above is to identify the version
  42.    *    of the all the files in this directory. given the above
  43. --- 1,5 ----
  44.   /*
  45. !  *    PathLevel: 12
  46.    *
  47.    *    the Patch Level above is to identify the version
  48.    *    of the all the files in this directory. given the above
  49. *** 1.4    1991/05/04 18:38:14
  50. --- makefile.16    1992/04/19 16:43:29
  51. ***************
  52. *** 9,15 ****
  53.   
  54.   MODEL = -I. -mshort
  55.   DEFINES = -DDGK -DGEMDOS
  56. ! COPTS= -O -fomit-frame-pointer -fcombine-regs -fstrength-reduce \
  57.    -DNDEBUG $(DEFINES) $(XFLAGS)
  58.   
  59.   # normal CFLAGS
  60. --- 9,15 ----
  61.   
  62.   MODEL = -I. -mshort
  63.   DEFINES = -DDGK -DGEMDOS
  64. ! COPTS= -O -fomit-frame-pointer -fstrength-reduce \
  65.    -DNDEBUG $(DEFINES) $(XFLAGS)
  66.   
  67.   # normal CFLAGS
  68. *** 1.4    1991/05/04 18:38:14
  69. --- makefile.32    1992/04/19 16:43:29
  70. ***************
  71. *** 9,15 ****
  72.   
  73.   MODEL = -I.
  74.   DEFINES = -DDGK -DGEMDOS
  75. ! COPTS= -O -fomit-frame-pointer -fcombine-regs -fstrength-reduce \
  76.    -DNDEBUG $(DEFINES) $(XFLAGS)
  77.   
  78.   # normal CFLAGS
  79. --- 9,15 ----
  80.   
  81.   MODEL = -I.
  82.   DEFINES = -DDGK -DGEMDOS
  83. ! COPTS= -O -fomit-frame-pointer -fstrength-reduce \
  84.    -DNDEBUG $(DEFINES) $(XFLAGS)
  85.   
  86.   # normal CFLAGS
  87. *** 1.5    1991/05/04 18:38:14
  88. --- tgetent.c    1992/04/19 16:43:33
  89. ***************
  90. *** 63,68 ****
  91. --- 63,73 ----
  92.    *
  93.    *    Modification by ERS: if no termcap file can be found, then
  94.    *    a default termcap is used (this is for GEMDOS).
  95. +  *
  96. +  *      Further mods by MJ: original routines fail to proces valid
  97. +  *      termcap files - replaced with new versions.
  98. +  *      Atari specific: default termcap used when nothing better is
  99. +  *      around reads a number of rows and colums from Line-A variables.
  100.    *    
  101.    *  RETURNS
  102.    *
  103. ***************
  104. *** 86,91 ****
  105. --- 91,97 ----
  106.   #include <stdio.h>
  107.   #include <string.h>
  108.   #include <termcap.h>
  109. + #include <ctype.h>
  110.   
  111.   #ifndef _COMPILER_H
  112.   #  include <compiler.h>
  113. ***************
  114. *** 102,115 ****
  115.   
  116.   # ifdef DGK
  117.   # define DEFAULT_ROOT "termcap"        /* name without path component */
  118.     static FILE *fopenp __PROTO((char *name, char *mode, char *pathname));
  119.   # define DEFAULT_FILE "\\etc\\termcap"
  120.   # else
  121.   # define DEFAULT_FILE "/etc/termcap"    /* default termcap filename */
  122.   # endif
  123. ! __EXTERN char *fgetlr __PROTO((char *bp, int bpsize, FILE *fp));
  124.   static FILE *find_file __PROTO((char *));
  125.   static int gotcha __PROTO((char *bp, char *name));
  126.   
  127.   char *_tcpbuf;                /* Place to remember buffer pointer */
  128.   
  129. --- 108,126 ----
  130.   
  131.   # ifdef DGK
  132.   # define DEFAULT_ROOT "termcap"        /* name without path component */
  133. + /**
  134.     static FILE *fopenp __PROTO((char *name, char *mode, char *pathname));
  135. + **/
  136.   # define DEFAULT_FILE "\\etc\\termcap"
  137.   # else
  138.   # define DEFAULT_FILE "/etc/termcap"    /* default termcap filename */
  139.   # endif
  140. ! /* __EXTERN char *fgetlr __PROTO((char *bp, int bpsize, FILE *fp)); */
  141. ! static int build_entry __PROTO((char *bp, char *stop, FILE *fp, char *name));
  142.   static FILE *find_file __PROTO((char *));
  143. + /**
  144.   static int gotcha __PROTO((char *bp, char *name));
  145. + **/
  146.   
  147.   char *_tcpbuf;                /* Place to remember buffer pointer */
  148.   
  149. ***************
  150. *** 139,145 ****
  151.    *        Return NO_ENTRY status.
  152.    *        End if
  153.    *    End tgetent
  154. !  *            
  155.    */
  156.   
  157.   int tgetent(bp,name)
  158. --- 150,167 ----
  159.    *        Return NO_ENTRY status.
  160.    *        End if
  161.    *    End tgetent
  162. !  *
  163. !  *    Modification by Michal Jagerman (April of 1992):
  164. !  *      The "While records left to process" is too simple minded
  165. !  *      since termcap entry in a buffer can be spliced from
  166. !  *    multiple pieces by using "tc" capability. Therefore
  167. !  *      we delegete the task of termcap buffer filling to
  168. !  *      a specialized internal function 'build_entry()'. This
  169. !  *      function also solves a problem of opening a termcap file
  170. !  *      in a 'wrong' mode by cleaning a termcap buffer from all
  171. !  *      leftovers.
  172. !  *
  173. !  *  
  174.    */
  175.   
  176.   int tgetent(bp,name)
  177. ***************
  178. *** 157,175 ****
  179.           return(NO_FILE);
  180.       }
  181.       } else {
  182. !     while (fgetlr(bp,BUFSIZE,fp)) {
  183. !         if (gotcha(bp,name)) {
  184. !         fclose(fp);
  185. !         if (bp[(int)strlen(bp)-1] != '\n') {
  186. !             return(TRUNCATED);
  187. !         } else {
  188. !             return(SUCCESS);
  189.           }
  190.           }
  191.       }
  192. !     return(NO_ENTRY);
  193.       }
  194.   }
  195.   
  196.   /*
  197.    *  INTERNAL FUNCTION
  198. --- 179,371 ----
  199.           return(NO_FILE);
  200.       }
  201.       } else {
  202. !     *bp++ = ':';
  203. !     return (build_entry(bp, bp + BUFSIZE - 1, fp, name));
  204. !     }
  205. ! }
  206. ! /*
  207. !  *  INTERNAL FUNCTION
  208. !  *
  209. !  *    build_entry    construct termcap entry in a given buffer
  210. !  *
  211. !  *  SYNOPSIS
  212. !  *
  213. !  *    static int build_entry(bp, stop, fp, name)
  214. !  *    char *bp, *stop, *name;
  215. !  *      FILE *fp;
  216. !  *
  217. !  *  DESCRIPTION
  218. !  *
  219. !  *      For a given name build in a buffer bp a termcap description
  220. !  *      using a contents of file fp.  Continue this until the entry
  221. !  *      is complete or we reached stop.  Concatenate entries if
  222. !  *      required by tc capability.   White space characters and
  223. !  *      backslashes escaping newlines are not copied into bp.
  224. !  *      Returns SUCCESS if there was no problems, NO_ENTRY if an
  225. !  *      entry with given name was not found and TRUNCATED if we
  226. !  *      run out of a buffer space or continuation entry specified
  227. !  *      with tc was not found
  228. !  *
  229. !  *  BUGS
  230. !  *
  231. !  *      Termcap specifications require for tc to be the last capability
  232. !  *      for the given name.  This is not enforced but anything which
  233. !  *      follows tc in the same description will be discarded.
  234. !  *      It is not entirely clear what we should return when continuation
  235. !  *      specified with tc failed.
  236. !  *      Other stuff which goes beyond termcap specs can be accepted.
  237. !  *      Terminal names starting with '#' are not accepted.
  238. !  *      Continuation with names over 127 characters long will likely bomb!
  239. !  *
  240. !  *  AUTHOR
  241. !  *
  242. !  *    Michal Jaegermann
  243. !  *
  244. !  */
  245. ! static int build_entry(bp, stop, fp, name)
  246. ! char *bp, *stop, *name;
  247. ! FILE *fp;
  248. ! {
  249. !     int c;
  250. !     int so_far, skip_all = 0;
  251. !     char *np;
  252. !     char nbuf[128];
  253. !     static int _tgetc __PROTO((FILE *fp));
  254. !     /* rewind file - we may seek for a continuation entry */
  255. !     rewind(fp);
  256. !     /*
  257. !      * this is FSM - sort of 
  258. !      */
  259. !     while (EOF != (c = getc(fp))) {
  260. !      /*
  261. !       * we are looking at a comment - skip it
  262. !       */
  263. !     if ('#' == c) {
  264. !         do {
  265. !         if (EOF == (c = getc(fp)))
  266. !             return NO_ENTRY;
  267. !         } while ('\n' != c);
  268. !     }
  269. !     /*
  270. !      * empty line or we finished comment traversal;
  271. !      * a little bit to good - but valid termcap file will be
  272. !      * stil accepted
  273. !      */
  274. !     if (isspace(c))
  275. !         continue;
  276. !     /*
  277. !      * try matching name
  278. !      */
  279. !     np = name;
  280. !     while (*np == c) {
  281. !         np += 1;
  282. !         c = _tgetc(fp);
  283. !     }
  284. !     /*
  285. !      * we finished traversing our name - is this really a match ?
  286. !      */
  287. !     if (*np == '\0') {
  288. !         if (c == '|' || c == ':')
  289. !         break; /* we have a match */
  290. !         if  (c == EOF)
  291. !         return (TRUNCATED); /* match - but we wanted more */
  292. !     }
  293. !     /*
  294. !      * no match - skip until next name or next entry
  295. !      * if we are past all possible names here 
  296. !      */
  297. !     skip_all = 0;
  298. !     while ('\n' != c) {
  299. !         if (':' == c)
  300. !         skip_all = 1; /* we are past all valid names for this entry */
  301. !         if ('|' == c && 0 == skip_all)
  302. !         break;
  303. !         c = _tgetc(fp);
  304. !     }
  305. !     }
  306. !     if (EOF == c)
  307. !     return (NO_ENTRY);
  308. !     while (':' != c)    /* skip the remainig variants of terminal names */
  309. !     c = _tgetc(fp); /* we do not want any mixups later             */
  310. !     /*
  311. !      * at last we got it - copy terminal description into bp
  312. !      */
  313. !     so_far = 0;  /* rough indicator how far we are into a capability */
  314. !     while ('\n' != (c = _tgetc(fp))) {
  315. !     if (0 == so_far && !isalpha(c))
  316. !         continue;     /* do not bother with all kind of spurious stuff */
  317. !     so_far++;
  318. !     if (1 == so_far && 't' == c ) {
  319. !         /* a special case - maybe we have "tc=" string? */
  320. !         if ((bp + 3) > stop) {
  321. !         ungetc(c, fp);
  322. !         continue;
  323. !         /* cheating with so_far, but we want to skip this case! */
  324. !         }
  325. !         *bp++ = c;
  326. !         c = _tgetc(fp);
  327. !         if ('c' == c) {
  328. !         *bp++ = c;
  329. !         c = _tgetc(fp);
  330. !         if ('=' == c) {
  331. !             /* we will continue with a name which follows */
  332. !             bp -= 2;
  333. !             /* copy new name to nbuf */
  334. !             np = nbuf;
  335. !             while (':' != (c = _tgetc(fp))) {
  336. !             if ('\n' == c || EOF == c)
  337. !                 break;
  338. !             *np++ = c;
  339. !             }
  340. !             *np = '\0';
  341. !             return (SUCCESS == build_entry(bp, stop, fp, nbuf) ?
  342. !                 SUCCESS : TRUNCATED);
  343.           }
  344.           }
  345. +     }  /* end of 'tc=' check */
  346. +     if (':' == c) /* literal colon cannot occur in capabilities strings -
  347. +                * one has to use '\072' instead */
  348. +         so_far =  0;
  349. +     *bp++ = c;
  350. +     if (bp >= stop)
  351. +         return(TRUNCATED);
  352. +     }
  353. +     if (bp < stop)
  354. +     *bp = '\0';
  355. +     return(SUCCESS);
  356. + }
  357. + /*
  358. +  * Auxilary function to read a character from a text file
  359. +  * with skipping escaped line terminators; any escaped
  360. +  * '\n' will be replaced by a character which follows.
  361. +  * After escape any number of ^M's will vanish,
  362. +  * i.e a string of three characters '\\', 0x0d, 'a' will read
  363. +  * as a string of two characters '\\', 'a' and so on...
  364. +  * We do not tolerate such garbage in text files. :-)
  365. +  */
  366. + static int _tgetc(fp)
  367. + FILE *fp;
  368. + {
  369. +     int c;
  370. +     if ('\\' == (c = getc(fp))) {
  371. +     while ('\r' == (c = getc(fp)))
  372. +         ;                /* Messy stuff - go away */
  373. +     if (c != '\n') {
  374. +         ungetc(c, fp);
  375. +         return ('\\');
  376.       }
  377. !     c = getc(fp);
  378.       }
  379. +     return(c);
  380.   }
  381.   
  382.   /*
  383.    *  INTERNAL FUNCTION
  384. ***************
  385. *** 234,244 ****
  386.    *
  387.    */
  388.   
  389. ! static char term_default[] = "df|default|Atari default\
  390. ! :al=\\EL:am:bs:cd=\\EJ:ce=\\EK:cl=\\EE:cm=\\EY%+ %+ :co#80:dl=\\EM\
  391. ! :do=\\EB:eo:ho=\\EH:is=\\Eq\\EE\\Ee\\Ev:it#8:le=^H:li#25:ll=\\EY9!\
  392. ! :me=\\Eq:mr=\\Ep:nd=\\EC:rc=\\Ek:sc=\\Ej:se=\\Eq:so=\\Ep:ta=^I\
  393. ! :up=\\EA:ve=\\Ee:vi=\\Ef:";
  394.   
  395.   static FILE *find_file(bp)
  396.   char *bp;
  397. --- 430,455 ----
  398.    *
  399.    */
  400.   
  401. ! #ifdef GEMDOS
  402. ! /*
  403. !  * we do not really need the following part once the stuff is in
  404. !  * our termcap  buffer
  405. !  */
  406. ! /* "df|default|Atari default"  */
  407. ! /*
  408. !  * this values we will try to fill to fit a given display
  409. !  */
  410. ! /* :co#80:li#25:\  */
  411. ! static char term_default[] = "\
  412. ! :al=\\EL:am:bs:cd=\\EJ:ce=\\EK:cl=\\EE:cm=\\EY%+ %+ :dl=\\EM\
  413. ! :do=\\EB:eo:ho=\\EH:is=\\Eq\\EE\\Ee\\Ev:it#8:pt:kb=^H:ll=\\EY9!\
  414. ! :me=\\Eq:mr=\\Ep:le=\\ED:nd=\\EC:rc=\\Ek:sc=\\Ej:se=\\Eq:so=\\Ep:ta=^I\
  415. ! :up=\\EA:ve=\\Ee:vi=\\Ef:km:bl=^G:cr=^M:ti=\\Ev\\Ee:sr=\\EI:sf=^J";
  416. ! #include <linea.h>
  417. ! #include <support.h>
  418. ! #endif
  419.   
  420.   static FILE *find_file(bp)
  421.   char *bp;
  422. ***************
  423. *** 268,278 ****
  424.           return fp;
  425.       else if (fp = fopen(DEFAULT_FILE, "r"))
  426.           return fp;
  427.       else if (fp = fopenp(DEFAULT_ROOT, "r", NULL))
  428.           return fp;
  429.       else {
  430.   #  ifdef GEMDOS
  431. !         strcpy (bp, term_default);
  432.   #  endif
  433.           return (FILE *) NULL;
  434.       }
  435. --- 479,507 ----
  436.           return fp;
  437.       else if (fp = fopen(DEFAULT_FILE, "r"))
  438.           return fp;
  439. +         else if (NULL !=
  440. +          (cp = findfile(DEFAULT_ROOT, getenv("PATH"), (char **)0)) &&
  441. +          (NULL != (fp = fopen(cp,"r"))))
  442. +                return fp;
  443. +             
  444. + /** this replaced by the above **
  445.       else if (fp = fopenp(DEFAULT_ROOT, "r", NULL))
  446.           return fp;
  447. + **/
  448.       else {
  449.   #  ifdef GEMDOS
  450. !         /* 
  451. !          * if we do not have any better information, then
  452. !          * we will try to glimpse screen sizes from Line-A variables
  453. !          */
  454. !         linea0();
  455. !         strcpy (bp, ":co#");
  456. !         (void) _ultoa((unsigned long) (V_CEL_MX + 1),
  457. !                   bp + sizeof(":co#") - 1, 10);
  458. !         strcat (bp, ":li#");
  459. !         (void) _ultoa((unsigned long) (V_CEL_MY + 1),
  460. !                   bp + strlen(bp), 10);
  461. !         strcat (bp, term_default);
  462.   #  endif
  463.           return (FILE *) NULL;
  464.       }
  465. ***************
  466. *** 280,285 ****
  467. --- 509,515 ----
  468.       return(fopen(DEFAULT_FILE,"r"));
  469.   # endif
  470.   }
  471. + #if 0  /* this is not used anymore */
  472.   
  473.   /*
  474.    *  INTERNAL FUNCTION
  475. ***************
  476. *** 360,365 ****
  477. --- 590,598 ----
  478.    * argument which can be NULL.  Otherwise this argument gets filled
  479.    * in the full path to the file.  Returns as does fopen().
  480.    */
  481. + /* On Atari ST use library routine findfile() instead */
  482.   static FILE *
  483.   fopenp(name, mode, pathname)
  484.   char *name, *mode, *pathname;
  485. ***************
  486. *** 393,395 ****
  487. --- 626,629 ----
  488.       return NULL;
  489.   }
  490.   #endif
  491. + #endif /* 0 */
  492. *** 1.7    1992/03/06 19:40:24
  493. --- xconsole.c    1992/04/19 16:43:35
  494. ***************
  495. *** 71,85 ****
  496.   } k_buf;
  497.   
  498.   static k_buf in_buf[NUMDEV];
  499. - #define IN_BUF(dev) (&in_buf[(dev) > 2 ? _console_dev : (dev)])
  500.   
  501.   /*
  502.    * what handle means:: 0-2: BIOS handle, 3: stdout, 4: stderr
  503.    */
  504.   
  505.   static short
  506.   LOOKUP(handle)
  507.   short handle;
  508.   {
  509.       switch(handle) {
  510.       case -3:
  511. --- 71,100 ----
  512.   } k_buf;
  513.   
  514.   static k_buf in_buf[NUMDEV];
  515.   
  516. + #define in_dev(dev) ((dev)>2 ? _console_dev : (dev))
  517. + #define IN_BUF(dev) (&in_buf[in_dev(dev)])
  518.   /*
  519.    * what handle means:: 0-2: BIOS handle, 3: stdout, 4: stderr
  520.    */
  521. + static short LOOKUP __PROTO((short handle));
  522. + static long raw_in __PROTO((int dev));
  523. + static long raw_instat __PROTO((int dev));
  524. + void flush_key_buff __PROTO((int dev));
  525. + #if 0
  526. + static void raw_out __PROTO((int dev, int c));
  527. + #endif
  528.   
  529.   static short
  530. + #ifdef __STDC__
  531. + LOOKUP(short handle)
  532. + #else
  533.   LOOKUP(handle)
  534.   short handle;
  535. + #endif
  536.   {
  537.       switch(handle) {
  538.       case -3:
  539. ***************
  540. *** 106,117 ****
  541.   raw_in(dev)
  542.   int dev;
  543.   {
  544. !     if (dev < 3)
  545. !         return Bconin(dev);
  546. !     else if (dev == 3)
  547. !         return Crawcin();
  548. !     else
  549. !         return Cauxin();
  550.   }
  551.   
  552.   #if 0
  553. --- 121,132 ----
  554.   raw_in(dev)
  555.   int dev;
  556.   {
  557. !   if (dev < 3)
  558. !     return Bconin (dev);
  559. !   else if (dev == 3)
  560. !     return Crawcin ();
  561. !   else
  562. !     return Cauxin ();
  563.   }
  564.   
  565.   #if 0
  566. ***************
  567. *** 132,143 ****
  568.   raw_instat(dev)
  569.   int dev;
  570.   {
  571. !     if (dev < 3)
  572. !         return Bconstat(dev);
  573. !     else if (dev == 3)
  574. !         return Cconis();
  575. !     else
  576. !         return Cauxis();
  577.   }
  578.   
  579.   /*
  580. --- 147,153 ----
  581.   raw_instat(dev)
  582.   int dev;
  583.   {
  584. !     return Bconstat(in_dev(dev));
  585.   }
  586.   
  587.   /*
  588. ***************
  589. *** 211,257 ****
  590.   int handle;
  591.   int n;
  592.   {
  593. !     long c;
  594. !     short i, j, waiting = 0;
  595. !     unsigned char ch;
  596. !     k_buf *p;
  597.       short dev;
  598.   
  599.       dev = LOOKUP(handle);
  600. -     p = IN_BUF(dev);
  601.   
  602. !     while (__check_signals && (raw_instat(dev) || waiting)) {
  603. !         c = raw_in(dev);
  604. !         if (!(__ttymode & RAW)) {
  605. !             ch = c & 0xff;
  606. !             if (ch == ('S'-'@')) {
  607. !                 waiting = 1;
  608. !             }
  609. !             else if (ch == ('Q'-'@')) {
  610. !                 waiting = 0;
  611. !             }
  612. !             else if (ch == __tchars[TC_INTRC]) {
  613. !                 p->head = p->tail;
  614. !                 raise(SIGINT);
  615. !             }
  616. !             else if (ch == __tchars[TC_QUITC]) {
  617. !                 p->head = p->tail;
  618. !                 raise(SIGQUIT);
  619. !             }
  620. !             else if (!waiting) {
  621. !                 i = p->head;
  622. !                 j = i + 1;
  623. !                 if (j >= KBUFSIZ) j = 0;
  624. !                 if (j != p->tail) {
  625. !                     p->buffer[i] = c;
  626. !                     p->head = j;
  627. !                 }
  628. !             }
  629. !         }
  630. !     }
  631. ! #if 0
  632. !     raw_out(dev, n);
  633. ! #endif
  634.       ch = n;
  635.       (void)Fwrite(handle, 1L, &ch);
  636.   }
  637. --- 221,234 ----
  638.   int handle;
  639.   int n;
  640.   {
  641. !     char ch;
  642.       short dev;
  643.   
  644.       dev = LOOKUP(handle);
  645.   
  646. !     if (__check_signals)
  647. !         flush_key_buff(dev);
  648. ! /*    raw_out(dev, n); */
  649.       ch = n;
  650.       (void)Fwrite(handle, 1L, &ch);
  651.   }
  652.